# @Time: 2025/5/10 11:22
# @Author: chenhui
import allure

def deal_with_res(data,res):
    request_url = str(res.request.url)
    allure.attach(request_url,"请求url")

    request_method = str(res.request.method)
    allure.attach(request_method, "请求方法")

    request_headers = str(res.request.headers)
    allure.attach(request_headers, "请求headers")

    request_data = str(data)
    allure.attach(request_data, "入参报文")

    request_time = str(res.elapsed.total_seconds()*1000)
    allure.attach(request_time + "毫秒", "响应时间")

    status_code = str(res.status_code)
    allure.attach(status_code, "状态码")

    request_text = str(res.text)
    allure.attach(request_text, "响应报文")
